Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.31-pr.226.5f9b2b0Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.31-pr.226.5f9b2b0"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.31-pr.226.5f9b2b0"
}
}
Preview published to npm registry — try new features instantly! |
| formatOutput(result.outputs) | ||
| ); | ||
| const { cli } = await runAllBuilds(); | ||
| for (const result of [cli]) { |
There was a problem hiding this comment.
This is a preparation for additional entry
cdbd97e to
75699b5
Compare
|
@claude review |
There was a problem hiding this comment.
this will help automatically to deal with lint errors regarding "non empty last line in file"
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
75afbfa to
6ef1465
Compare
src/cli/dev/dev-server/main.ts
Outdated
| const AUTH_LOGIN_PATTERN = /^\/api\/apps\/auth(\/\w+)?\/login/; | ||
| app.use((req, res, next) => { | ||
| if (AUTH_LOGIN_PATTERN.test(req.path)) { | ||
| const targetUrl = `https://base44.app${req.originalUrl}`; |
There was a problem hiding this comment.
Consider using new URL, then we can do something like
// save the base url
const BASE44_APP_URL = 'https://base44.app';
new URL(req.originalUrl, BASE44_APP_URL)
src/cli/dev/dev-server/main.ts
Outdated
| // (redirects + session cookies) works correctly. Proxying breaks OAuth | ||
| // because the session cookie ends up on localhost while Google's callback | ||
| // goes to base44.app. | ||
| const AUTH_LOGIN_PATTERN = /^\/api\/apps\/auth(\/\w+)?\/login/; |
There was a problem hiding this comment.
let's test/check if there's a signup url we need to handle
4d73f20 to
a452cc1
Compare
src/cli/dev/dev-server/main.ts
Outdated
| const AUTH_LOGIN_PATTERN = /^\/api\/apps\/auth(\/\w+)?\/login/; | ||
| app.use((req, res, next) => { | ||
| if (AUTH_LOGIN_PATTERN.test(req.path)) { | ||
| const targetUrl = `https://base44.app${req.originalUrl}`; |
src/cli/dev/dev-server/main.ts
Outdated
| // (redirects + session cookies) works correctly. Proxying breaks OAuth | ||
| // because the session cookie ends up on localhost while Google's callback | ||
| // goes to base44.app. | ||
| const AUTH_LOGIN_PATTERN = /^\/api\/apps\/auth(\/\w+)?\/login/; |
| return new Promise((resolve, reject) => { | ||
| const server = app.listen(port, "127.0.0.1", (err) => { | ||
| if (err) { | ||
| if ("code" in err && err.code === "EADDRINUSE") { | ||
| reject( | ||
| new Error( | ||
| `Port ${port} is already in use. Stop the other process and try again.`, | ||
| ), | ||
| ); | ||
| } else { | ||
| reject(err); | ||
| } | ||
| } else { | ||
| resolve({ | ||
| port, | ||
| server, | ||
| }); | ||
| } | ||
| }); | ||
| }); |
| { | ||
| "recommendations": ["biomejs.biome"] | ||
| } |
There was a problem hiding this comment.
plugin needed for correct work.
Without it nothing will correctly happened and it will be the same experience as before - only lints when you run bun run lint:fix
| "editor.defaultFormatter": "biomejs.biome" | ||
| }, | ||
| "[jsonc]": { | ||
| "editor.defaultFormatter": "biomejs.biome" |
There was a problem hiding this comment.
Missed it last time, should be explicit
src/cli/dev/dev-server/main.ts
Outdated
| import express from "express"; | ||
| import { createProxyMiddleware } from "http-proxy-middleware"; | ||
|
|
||
| const DEFAULT_PORT = 3000; |
src/cli/dev/dev-server/main.ts
Outdated
| const AUTH_ROUTE_PATTERN = /^\/api\/apps\/auth(\/|$)/; | ||
| app.use((req, res, next) => { | ||
| if (AUTH_ROUTE_PATTERN.test(req.path)) { | ||
| const targetUrl = `${BASE44_APP_URL}${req.originalUrl}`; |

Note
Description
This PR adds a new
base44 devcommand that starts a local development server proxying to the production Base44 API. The dev server enables local frontend development with CORS support, OAuth redirect handling, and automatic port selection when the default port (4400) is already in use.Related Issue
None
Type of Change
Changes Made
base44 devcommand (src/cli/commands/dev.ts) with optional--portflagsrc/cli/dev/dev-server/main.ts) with:https://base44.appfor API requestsinfra/build.ts) to support multiple build targetsexpress,cors,http-proxy-middleware,get-port, and their TypeScript types.editorconfigfor consistent code formatting across editorsTesting
npm test)Checklist
Additional Notes
The dev server is marked as
hidden: truein the CLI program, indicating this is an experimental or internal-use feature. The server redirects OAuth authentication routes directly to base44.app rather than proxying them, which preserves the OAuth flow and session cookie handling required by authentication providers.The port handling logic gracefully handles the case where port 4400 is already in use, automatically finding the next available port using the
get-portpackage.🤖 Generated by Claude | 2026-02-11 19:28 UTC